package com.zhw.utils;

import VO.ResultVO;
import com.zhw.enums.ProductStatusEnum;

/**
 * Created by Administrator on 2018/4/15.
 */
public class ResultVOUtil {


    public static ResultVO success(Object object){

        ResultVO resultVO=new ResultVO();
        resultVO.setData(object);
        resultVO.setCode(0);  // 前端会判断0才会给显示
        resultVO.setMsg("成功");
        resultVO.setData(object);
        return resultVO;

    }

    public static ResultVO success() {
        return success(null);
    }

    public static ResultVO error(Integer code, String msg) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
    }

}
